cmake_minimum_required(VERSION 3.15) 
project(module_demo)

# set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "/usr/local/Cellar/cmake/3.18.3/share/cmake/Modules")
# list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
# message(STATUS CMAKE_MODULE_PATH=${CMAKE_MODULE_PATH})



find_package(wxWidgets COMPONENTS core base REQUIRED)

# include_directories(${wxWidgets_INCLUDE_DIRS})
include( "${wxWidgets_USE_FILE}" )

add_executable(${PROJECT_NAME} src/HelloWorldApp.cpp)
target_link_libraries(${PROJECT_NAME} ${wxWidgets_LIBRARIES})

# find_package(ZLIB)

# message(STATUS ZLIB_FOUND=${ZLIB_FOUND})
# if(ZLIB_FOUND)
#     message("test: The library ZLIB has been found.")
# else()
#     message("test: The library ZLIB was not found.")
# endif()

# set(package_name wxWidgets)
# find_package(${package_name})
# message(STATUS ${package_name}_FOUND=${${package_name}_FOUND})
# if(${package_name}_FOUND)
#     message("test: The library ${package_name} has been found.")
#     message(STATUS ${package_name}_INCLUDE_DIRS=${${package_name}_INCLUDE_DIRS})
#     message(STATUS ${package_name}_LIBRARIES=${${package_name}_LIBRARIES})
#     message(STATUS ${package_name}_LIBRARY_DIRS=${${package_name}_LIBRARY_DIRS})
#     message(STATUS ${package_name}_CXX_FLAGS=${${package_name}_CXX_FLAGS})
# else()
#     message("test: The library ${package_name} was not found.")
# endif()





# message(STATUS "hello")
# message("hello")

# # Older cmake versions don't support string(APPEND ...) provide a workaround
# macro(wx_string_append var str)
#     set(${var} ${${var}}${str})
# endmacro()

# # Add a option and mark is as advanced if it starts with wxUSE_
# # wx_option(<name> <desc> [default] [STRINGS strings])
# # The default is ON if not third parameter is specified
# function(wx_option name desc)
#     cmake_parse_arguments(OPTION "" "" "STRINGS" ${ARGN})
#     if(ARGC EQUAL 2)
#         set(default ON)
#     else()
#         set(default ${OPTION_UNPARSED_ARGUMENTS})
#         message(STATUS default=${default})
#     endif()

#     if(OPTION_STRINGS)
#         set(cache_type STRING)
#     else()
#         set(cache_type BOOL)
#     endif()

#     set(${name} "${default}" CACHE ${cache_type} "${desc}")
#     string(SUBSTRING ${name} 0 6 prefix)
#     if(prefix STREQUAL "wxUSE_")
#         mark_as_advanced(${name})
#     endif()
#     message(STATUS OPTION_STRINGS=${OPTION_STRINGS})
#     if(OPTION_STRINGS)
#         set_property(CACHE ${name} PROPERTY STRINGS ${OPTION_STRINGS})
#         # Check valid value
#         set(value_is_valid FALSE)
#         set(avail_values)
#         foreach(opt ${OPTION_STRINGS})
#             message(STATUS opt=${opt})
#             if(${name} STREQUAL opt)
#                 set(value_is_valid TRUE)
#                 break()
#             endif()
#             wx_string_append(avail_values " ${opt}")
#         endforeach()
#         if(NOT value_is_valid)
#             message(FATAL_ERROR "Invalid value \"${${name}}\" for option ${name}. Valid values are: ${avail_values}")
#         endif()
#     endif()
# endfunction()

# # wx_option(wxBUILD_SHARED "Build wx libraries as shared libs" ${BUILD_SHARED_LIBS})
# # wx_option(wxBUILD_MONOLITHIC "build wxWidgets as single library" OFF)
# # wx_option(wxBUILD_SAMPLES "Build only important samples (SOME) or ALL" OFF
# #     STRINGS SOME ALL OFF)
# # wx_option(wxBUILD_TESTS "Build console tests (CONSOLE_ONLY) or ALL" OFF
# #     STRINGS CONSOLE_ONLY ALL OFF)
# # wx_option(wxBUILD_DEMOS "Build demos" OFF)
# # wx_option(wxBUILD_BENCHMARKS "Build benchmarks" OFF)
# # wx_option(wxBUILD_PRECOMP "Use precompiled headers")
# wx_option(wxBUILD_DEBUG_LEVEL "Debug Level" 2 STRINGS Default 0 1 2)  

# # message(STATUS wxBUILD_SHARED=${wxBUILD_SHARED})
# # message(STATUS wxBUILD_MONOLITHIC=${wxBUILD_MONOLITHIC})
# # message(STATUS wxBUILD_SAMPLES=${wxBUILD_SAMPLES})
# # message(STATUS wxBUILD_TESTS=${wxBUILD_TESTS})
# # message(STATUS wxBUILD_DEMOS=${wxBUILD_DEMOS})
# # message(STATUS wxBUILD_BENCHMARKS=${wxBUILD_BENCHMARKS})
# # message(STATUS wxBUILD_PRECOMP=${wxBUILD_PRECOMP})
# message(STATUS wxBUILD_DEBUG_LEVEL=${wxBUILD_DEBUG_LEVEL}) 